package com.exammple.redis;

import java.util.concurrent.TimeUnit;

import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.outstanding.framework.base.cache.OutstandingCacheService;
import com.outstanding.framework.core.PendingException;

public class RedisDemo {
	public static void main(String[] args) throws InterruptedException, PendingException {
		ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext("classpath*:/spring/*Beans.xml");
		context.start();
		OutstandingCacheService bean = context.getBean(OutstandingCacheService.class);
		bean.put("demo", "123", 1, TimeUnit.MINUTES);
		Object object = bean.get("demo");
		System.out.println(object);
		assert "123".equals(object);
		Thread.sleep(70000);
		assert bean.get("demo") == null;

	}
}
